package com.bao.work.work01;

import java.math.BigDecimal;

/**
 * @author baoye
 * @date 2024-08-01/19:39
 */
public class Book {
    private String id;
    private String name;
    private BigDecimal price;
    private String out;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Book book = (Book) o;

        return id != null ? id.equals(book.id) : book.id == null;
    }

    @Override
    public int hashCode() {
        return id != null ? id.hashCode() : 0;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public String getOut() {
        return out;
    }

    public void setOut(String out) {
        this.out = out;
    }

    public Book(String id, String name, BigDecimal price, String out) {
        this.id = id;
        this.name = name;
        this.price = price;
        this.out = out;
    }

    public Book() {
    }

    @Override
    public String toString() {
        return id+"\t\t"+name+"\t\t"+price+"\t\t"+out;
    }
}
